#include <iostream>

using namespace std;

const int N = 10;
int Tree[N];

int arr[][2] = {{1, 3}, 
                {4, 3}};

int findRoot(int x)
{
    if (-1 == Tree[x])
    {
        return x;
    }
    else 
    {
        return findRoot(Tree[x]);
    }
}

void func()
{
    int a,b;
    for (int i = 0; i < 2; ++i)
    {
        a = findRoot(arr[i][0]);
        b = findRoot(arr[i][1]);
        if (a != b)
        {
            Tree[a] = b;
        }
    }
}

int main(int argc, char *argv[])
{
    return 0;
}
